<include file="Public:header" />













<div style="background:#fff; height:40px; line-height:40px; border-bottom:1px solid #ccc; text-align:center;" class="headernav1">
    <a href="javascript:history.go(-1);" style="height:40px; width:40px; display:block; float:left; text-align:center;"><i class="fa fa-angle-left"></i></a>
    
    <i style="color:#ff1b51;" class="fa fa-file-text-o"></i> 我的订单

    <a href="{:U('Home/Cart/index')}" style="height:40px; width:40px; display:block; float:right; text-align:center;"><i class="fa fa-cart-plus"></i></a>
</div>









<style>
.headernav1 .fa{font-size:20px;}
.headernav{display:none;}
@media (min-width: 50px) {
.nav-justified>li {
	display: table-cell;
	width: 1%;
}
}
.panel-body {
	padding: 5px 5px;
}
.panel {
	margin-bottom: 0px;
}
.nav-justified>li>a {
	margin-bottom: 0;
	border-radius: 0;
	padding: 5px 0;
}
body {
	background: #d7dce3;
}
.nav-justified>li {
	background: none;
}
.nav-justified>li.active>a {
	margin-bottom: -1px;
	background: #ff1c51;
	color: #fff;
}
.order .media-body, .media-left, .media-right {
	vertical-align: middle;
}
</style>

<div style="padding-bottom:0px; width:100%; background:#ccc;">
  <ul class="nav nav-pills nav-justified" style="border-bottom:1px solid #cccccc;background:#fff;">
    <li role="presentation" 
    <if condition="$state eq 0">class="active"</if>
    ><a href="{:U('Order/index')}">全部</a>
    </li>
    <li role="presentation" 
    <if condition="$state eq 1">class="active"</if>
    ><a href="{:U('Order/index',array('state'=>1))}">待支付</a>
    </li>
    <li role="presentation" 
    <if condition="$state eq 2">class="active"</if>
    ><a href="{:U('Order/index',array('state'=>2))}">待发货</a>
    </li>
    <li role="presentation" 
    <if condition="$state eq 3">class="active"</if>
    ><a href="{:U('Order/index',array('state'=>3))}">已发货</a>
    </li>
    <li role="presentation" 
    <if condition="$state eq 7">class="active"</if>
    ><a href="{:U('Order/index',array('state'=>7))}">已取消</a>
    </li>
    <li role="presentation" 
    <if condition="$state eq 6">class="active"</if>
    ><a href="{:U('Order/index',array('state'=>6))}">已完成</a>
    </li>
  </ul>
</div>
<volist name="list" id="vo">
  <div class="order" style="padding:0; margin-top:5px;">
    <div class="panel panel-default">
      <div class="panel-heading">订单号:{$vo.ordernumber}
        <div style=" float:right;">
        
        
        <p><!-- 付款状态 -->
          <eq name="vo['status']" value="0"> <strong style="color:red;">已取消</strong> </eq>
          <eq name="vo['status']" value="1"> <strong style="color:#333;">待支付</strong> </eq>
          <eq name="vo['status']" value="2"> <strong style="color:#ff2788;">已支付</strong> </eq>
          <eq name="vo['confirm']" value="1"> <strong style="color:#ff2788;">已完成</strong> </eq>
          
          
            <eq name="vo['service_status']" value="1"> 退货中 </eq>
            <eq name="vo['service_status']" value="2"> 换货中 </eq>
            <eq name="vo['service_status']" value="3"> 部分退货 </eq>
            <eq name="vo['service_status']" value="4"> 全部退货 </eq>
          <!-- 付款状态结束 --> 
          
          <!-- 发货状态 -->
            <eq name="vo['service_status']" value="0">
          <eq name="vo['status']" value="2">
            <eq name="vo['shipping_status']" value="0"> 待发货 </eq>
            <eq name="vo['shipping_status']" value="1"> 部分发货 </eq>
            <eq name="vo['shipping_status']" value="2"> 全部发货 </eq>
            <eq name="vo['shipping_status']" value="3"> 部分确认 </eq>
            <eq name="vo['shipping_status']" value="4"> 全部确认 </eq>
          </eq>
          </eq>
              
          <!--- 发货状态结束 --> </p>
        
          
          
         
        
        
        </div>
      </div>
      <div class="panel-body" style="background:#fff;">
        <div class="media" style="margin-bottom:5px; border-bottom:1px solid #ccc; padding-bottom:4px;">
          <div class="media-left media-middle"> <a href="{:U('Order/read',array('id'=>$vo['id']))}"><img style="border:1px solid #eee; padding:1px;" src="/Public/{$vo.sale.0.img_url}" width="80" height="80"> </a> </div>
          <div class="media-body" style="position:relative;">
            <h4 class="media-heading" style="color:#333;">{$vo.sale.0.title}</h4>
            
            
            
            
            
          </div>
        </div>
        <div style="float:left; height:34px; line-height:34px;"><span style="color:#333; font-family:'微软雅黑';">实付款：</span><strong style="color:#f00; font-weight:bold; font-family:Arial;">¥{$vo.total}</strong>&nbsp;&nbsp; 
          
          
        </div>
        <div style=" float:right;"> 
          
          <!-- 未付款可以取消或者去支付 -->
          
          <if condition="$vo.status eq 1"> <a href="{:U('pay', array('id' => $vo['id']))}" class="btn btn-success">去支付</a> <a onClick="return confirm('您确定要取消吗？');" href="{:U('Member/Order/cancel' , array('id' => $vo['id']))}" class="btn btn-default">取消订单</a> </if>
          <!-- 未付款可以取消或者去支付end --> 
          
          <!-- 已经支付，但是没有发货，会员可以退款 -->
          <if condition="$vo.status eq 2"> 
            <!-- 没有发货，会员可以退款 --> 
            <?php if((M('Sale')->where(' order_id = '.$vo['id'])->getField('price'))!=0.01){ ?>
            <eq name="vo['service_status']" value="0"> <a href="{:U('Order/read',array('id'=>$vo['id']))}" class="btn btn-default">退款</a> </eq>
            <eq name="vo['service_status']" value="1"> <a href="{:U('Order/read',array('id'=>$vo['id']))}" class="btn btn-default">退款</a> </eq>
             <?php } ?>
            <!-- 没有发货，会员可以退款end --> 
            <!-- 发货后会员可以确认或者退货以及查看物流信息 -->
            <if condition="$vo.shipping_status neq 0"> <a class="btn btn-success" href="{:U('Order/read',array('id'=>$vo['id']))}">订单详情</a> </if>
            <!-- 发货后会员可以确认或者退货以及查看物流信息end --> 
            <!-- 确认收货以后才可以完成订单 -->
            
            <if condition="$vo.shipping_status eq 4 and $vo.confirm neq 1"> <a onClick="return confirm('您确定要完成吗？');"  class="btn btn-success" href="{:U('Order/confirm',array('id'=>$vo['id']))}">完成订单</a> </if>
            
            <!-- 确认收货以后才可以完成订单end --> 
            
          </if>
          <!-- 已经支付end  --> 
          
          <!-- 订单状态end  --> 
          
        </div>
        <div style="clear:both;"></div>
      </div>
    </div>
  </div>
</volist>
<div></div>
<empty name="list">
  <div style="text-align:center; position:absolute; top:40%; left:50%; width:200px; margin-left:-100px;"> <i class="fa fa-th-large" style="font-size:80px; border-radius:50px; background:#ccc; display:inline-block; width:100px; height:100px; color:#E7E7E7; line-height:100px; text-align:center; margin-bottom:12px;"></i> <br>
    <p>暂时无订单</p>
    <a href="__APP__/" class="btn btn-success">去选购</a></div>
</empty>
<div style="text-align:center;">{$pages}</div>
<include file="Public:footer" />